package com.emspost.enums;

/**
 * @author fengqibin
 * @since 2025-07-09
 */

public enum RiskChainTypeEnum {

    /**
     * 风控链类型枚举类
     *
     */
    EVENT("EVENT", "事件"),
    DECISION("DECISION", "决策"),
    STRATEGY("STRATEGY", "策略"),
    ;

    /**
     * 代码
     */
    private String type;

    /**
     * 描述
     */
    private String msg;


    RiskChainTypeEnum(String type, String msg) {
        this.type = type;
        this.msg = msg;
    }

    public static RiskChainTypeEnum of(String type) {
        for (RiskChainTypeEnum apiTypeEnum : RiskChainTypeEnum.values()) {
            if (apiTypeEnum.getType().equals(type)) {
                return apiTypeEnum;
            }
        }
        return null;
    }

    public static String getMsgByType(String type) {
        for (RiskChainTypeEnum apiTypeEnum : RiskChainTypeEnum.values()) {
            if (apiTypeEnum.getType().equals(type)) {
                return apiTypeEnum.getMsg();
            }
        }
        return "";
    }

    public String getType() {
        return type;
    }


    public String getMsg() {
        return msg;
    }
}
